Reports of procmail's death are not terribly exaggerated
The mail delivery agent (MDA) procmail is a Linux and Unix mainstay; for years it has been the recommended solution for sorting large volume email and filtering out spam. The trouble is that it is dead, and it has been for close to a decade. Or at least that may be the problem, depending on how you look at it. The question of when (or if) to declare an open source project dead does not have a clear answer, and many people still use procmail to process email on high-capacity systems.
For those unfamiliar with it, MDAs like procmail receive incoming mail from mail transport agents (MTAs) like Sendmail or Postfix, then process the received messages according to user-defined "recipes." Recipes examine the headers and body of messages, and are usually used to sort email to different mailboxes, forward messages to different addresses, and perhaps most importantly, to recognize and dispose of spam — often by triggering an external spam filtering tool like SpamAssassin. Recipes can also modify messages themselves, such as to truncate dangerously long message bodies or abbreviate irritatingly-long recipient lists.
Officially, the last stable procmail release was version 3.22, made in September of 2001. As one might expect, there has never been an official "the project is dead" announcement. Instead, only circumstantial evidence exists. Although several of the FTP mirrors include what appear to be development "snapshot" packages as recent as November of 2001, there does not appear to have been any substantial work since that time. The developers' mailing list has hardly seen a non-spam blip since 2003.
A side effect of a project abandoned that long ago is that there was no web-based source code repository at the time, even though such repositories are a fixture today, so only the tarballed releases uploaded to the FTP or HTTP download sites exist for FOSS archaeologists to examine. Similarly, a great many of the links on the official project page, including mailing list archives, external FAQ pages, and download mirrors, have succumbed to link-rot over the years and no longer provide access to useful information for those just getting started.
I'm not dead yet
Despite all this, procmail still has a loyal following. The procmail users' mailing list is actually quite active, with most of the traffic focusing on helping administrators maintain procmail installations and write or debug recipes. Reportedly, many of today's current procmail users are Internet service providers (ISPs), who naturally have an interest in maintaining their existing mail delivery tool set.
procmail's defenders usually cite its small size and its steady reliability as reasons not to abandon the package. A discussion popped up on the openSUSE mailing list in mid-November about whether or not the distribution should stop packaging procmail; Stefan Seyfried replied by saying that rather than dying ten years ago, the program was "finished
" ten years ago:
In a similar vein, when Robert Holtzman asked on the procmail users' list whether or not the project was abandoned, Christopher L. Barnard replied "It works, so why mess with it? It does what in needs, no more development is needed...
"
But there are risks inherent in running abandonware, even if it was of stellar quality at the last major release. First and foremost are unfixed security flaws. Mitre.org lists two vulnerabilities affecting procmail since 2001: CVE-2002-2034, which allows remote attackers to bypass the filter and execute arbitrary code by way of specially-crafted MIME attachments, and CVE-2006-5449, which uses a procmail exploit to gain access to the Horde application framework. In addition, of course, there are other bugs that remain unfixed. Matthew G. Saroff pointed out one long-standing bug, and the procmail site itself lists a dozen or so known bugs as of 2001.
Just as importantly, the email landscape and the system administration marketplace have not stood still since 2001, either. Ed Blackman noted that procmail cannot correctly handle MIME headers adhering to RFC 2047 (which include non-ASCII text), despite the fact that RFC 2047 dates back to 1996. RFC 2047-formatted headers are far from mandatory, but they do continue to rise in frequency.
Bart Schaefer notes that every now and then, someone floats the possibility of a new maintainer stepping up — but no one ever actually does so. Regardless of the theoretical questions about whether there are unfixed bugs, surely that practical reality provides the answer no one can arrive at by other logic: if no one works on the code, and no one is willing to work on the code, then surely it can be called abandoned.
What's a simple procmail veteran to do?
The most often-recommended replacement for procmail is Maildrop, an application developed by the Courier MTA project. Like procmail, Maildrop reads incoming mail on standard input and is intended to be called by the MTA, not run directly. It also requires the user to write message filters in a regular-expression-like language, but it reportedly uses an easier-to-read (and thus, easier-to-write) syntax.
The project also advertises several feature and security improvements over procmail, such as copying large messages to a temporary file before filtering them, as opposed to loading them into memory. Maildrop can also deliver messages to maildir mailboxes as well as to mbox mailboxes; procmail natively supports just mbox, although it can be patched (as distributions seem to have done) or use an external program to deliver to maildir mailboxes.
The merits of the competing filter-writing syntaxes are a bit subjective, but it is easy to see that procmail's recipe syntax is more terse, using non-alphabetic characters and absolute positioning in place of keywords like "if" and "to." For example, the Maildrop documentation provides some simple filter rules, such as this filter that is triggered by the sender address boss@domain.com and includes the string "project status" somewhere in the Subject line:
if (/^From: *boss@domain\.com/ \
&& /^Subject:.*[:wbreak:]project status[:wbreak:]/)
{
cc "!john"
to Mail/project
}
The action enclosed in curly braces routes the message to the Mail/project folder, and forwards a copy of the message to the user "john." An equivalent in procmail's recipe language might look like this instead:
:0:
* ^From.*boss@domain\.com
* ^Subject:.*(project status)
${DEFAULT}/project
! john@domain.com
The first line specifies that this is a new recipe; the trailing colon tells procmail to lock the mail file, which is necessary when saving the message to disk. The asterisks and exclamation point that begin lines are operators indicating new "conditions" and the forwarding action, respectively — neither is part of a regular expression. As you can see, the Maildrop syntax is not noticeably longer, but it could be easier to mentally parse late at night — particularly if reading filters written by someone else. Regrettably there does not seem to be an active project to automatically convert procmail recipes to Maildrop filters, which means switching between the packages requires revisiting and rewriting the rules.
Maildrop is not the only actively maintained MDA capable of filling in for procmail, although it is the easiest to switch to, by virtue of running as a standard-in process. Dovecot's Local Delivery Agent (LDA) module, for instance, has a plugin that allows administrators to write filtering rules in the Sieve language (RFC 5228). Maildrop has an advantage over LDA, though, in that in addition to Courier, it is also designed to work with the Qmail and Postfix MTAs.
If you are currently running procmail without any trouble, then there is certainly no great need to abandon it and switch to Maildrop or any other competitor. OpenSUSE, for its part, eventually concluded that there was no reason to stop packaging procmail, for the very reasons outlined above: it works, and people are still using it. However, ten years is a worryingly long time to go without an update. The simple fact that there are only two CVEs related to procmail since its last release is in no way a guarantee that it is exploit- or remote-exploit-free. At the very least, if your mail server relies on the continued availability of procmail, now is a good time to start examining the alternatives. Lumbering undead projects can do a lot of damage when they trip and fall.
| Index entries for this article | |
|---|---|
| GuestArticles | Willis, Nathan |
Posted Nov 24, 2010 22:34 UTC (Wed)
by armijn (subscriber, #3653)
[Link] (2 responses)
Posted Nov 25, 2010 10:34 UTC (Thu)
by armijn (subscriber, #3653)
[Link]
Posted Dec 4, 2010 18:55 UTC (Sat)
by Comet (subscriber, #11646)
[Link]
Unfortunately, while Sieve is designed to be regular enough that tools can manipulate the language directly, the web UIs I saw when I last looked (a few years ago, admittedly) all maintained their own state, serialized into comments in the sieve scripts, and the actual directives would be regenerated from those, so that while Sieve remained a lingua franca for humans reading the scripts, machine-based manipulation interoperability was lost.
Note that while IMAP Sieve is good, having Sieve scripts run by the LDA from the MUA can let you reject without having to generate bounces locally, reducing backscatter. Eg, Exim's Sieve support with pysieved for a ManageSieve interface.
I'm comfortable working with config files directly, so just use sieve-connect to manipulate the scripts, but since there are desktop clients for Gnome and MacOS now, perhaps those are worth a look?
Posted Nov 24, 2010 22:54 UTC (Wed)
by sspans (guest, #43276)
[Link] (6 responses)
Posted Nov 25, 2010 0:45 UTC (Thu)
by paravoid (subscriber, #32869)
[Link] (1 responses)
(to be fair, it's not bad code per se, it's just plain weird)
Posted Nov 27, 2010 14:29 UTC (Sat)
by HelloWorld (guest, #56129)
[Link]
Posted Nov 25, 2010 13:42 UTC (Thu)
by nix (subscriber, #2304)
[Link] (3 responses)
(but yes, the source code is *ew*. I suspect the first act of any new maintainer must be to run it through indent.)
Posted Nov 29, 2010 17:39 UTC (Mon)
by jeremiah (subscriber, #1221)
[Link] (1 responses)
Posted Nov 29, 2010 20:07 UTC (Mon)
by nix (subscriber, #2304)
[Link]
Posted Dec 3, 2010 11:31 UTC (Fri)
by DonDiego (guest, #24141)
[Link]
Posted Nov 25, 2010 2:28 UTC (Thu)
by thedevil (guest, #32913)
[Link] (1 responses)
As is apparent from the code I considered adding sieve support, but I could not motivate myself because I'll always prefer python :-)
Posted Nov 26, 2010 20:06 UTC (Fri)
by Bordelon (guest, #70697)
[Link]
Posted Nov 25, 2010 3:08 UTC (Thu)
by Tara_Li (guest, #26706)
[Link] (6 responses)
And I'm still *VERY* fuzzy on what the advantage of all this stuff is over keyword = value config files - don't start with the XML crap, either, it's mostly a longer version of keyword = value...
Posted Nov 25, 2010 4:27 UTC (Thu)
by jamesh (guest, #1159)
[Link] (2 responses)
This isn't the same as using a full fledged programming language to parse a simple key/value configuration file.
Posted Nov 26, 2010 16:40 UTC (Fri)
by HelloWorld (guest, #56129)
[Link] (1 responses)
Posted Nov 26, 2010 21:32 UTC (Fri)
by giraffedata (guest, #1954)
[Link]
I wonder what your definition of programming is such that writing these rules isn't it. It seems to me that writing a procmail rule file involves the same skills and mental processes as, say, writing a Bash program, which I assume falls within your definition of programming. It's a matter of composing software to control a machine. In a company, it's probably the same person who does both.
There is a continuum from programming to simple end use (setting the time zone on a computer isn't programming), and the line of demarcation is fuzzy, but coding the configuration files I see in the article fall well on the programming side of it in my opinion. If a graphical tool to build mail handling rules is complex enough, I would call that programming too. Programming doesn't have to be done in text (the original programming was done by plugging wires).
Posted Nov 25, 2010 6:52 UTC (Thu)
by rgmoore (✭ supporter ✭, #75)
[Link] (1 responses)
Show the designers a keyword = value config file that is as powerful as a regexp while maintaining similar size, and I'm sure they'll be happy to adopt it. But for this specific application, you really need a full regexp engine to do what you want to do. It might be possible to improve readability a bit with some syntactic sugar, but that's a very tricky balancing act. It's very easy to bloat the syntax to the point that it loses readability.
More generally, I share your dislike for overuse of XML but I understand it. XML is a fairly heavyweight solution, but it comes with some really nice tools that make it easy to read, write, and validate. I get the impression that people wind up using even when they might be better served with a lightweight keyword = value file because they want to be future proof- who knows if the config file might blow up into a monster in the future- and because they know and are used to working with the XML toolset.
Posted Nov 25, 2010 13:44 UTC (Thu)
by nix (subscriber, #2304)
[Link]
The syntax may be rebarbative, but procmailrc surely is a language.
Posted Nov 25, 2010 11:33 UTC (Thu)
by neilbrown (subscriber, #359)
[Link]
You at least need some macroscopic structure. Sometimes [sectionname] (using the the config files used by samba and many others) is enough, but sometimes you really do what an hierarchical structure. And in that case, mimicking the structure of a programming language makes sense (though I would prefer to follow python myself).
... because really, there is no difference between the 'program' and the 'data' - they are both streams of bytes and both need to be interpreted by some machine...
Posted Nov 25, 2010 7:43 UTC (Thu)
by rsidd (subscriber, #2582)
[Link] (1 responses)
Posted Nov 28, 2010 16:32 UTC (Sun)
by mtaht (guest, #11087)
[Link]
While I liked the clarity and simplicity of the language... and the power of dovecot's imap server... and having stuff in Maildir format...
The idea of piping your now-filtered email through another program is missing from that version of sieve! It's a one stop only filter.
So I lost the ability to do additional processing on the email itself as it came in, for example, when I get email from certain people I used to feed it into a speech synth (instead of "You've GOT Mail", I get "You've got mail from Joe")
If sieve had a "pipe" plugin so I wouldn't have lost this crucial facility of procmail I'd be a much happier camper.
Posted Nov 25, 2010 10:46 UTC (Thu)
by ballombe (subscriber, #9523)
[Link] (2 responses)
But anyway, I really doubt procmail will disappear. There is too much infrastructure build around it.
Posted Nov 26, 2010 14:59 UTC (Fri)
by n8willis (subscriber, #43041)
[Link] (1 responses)
In those last few scenarios, procmail itself doesn't have to disappear in any real sense; rather users will just slowly atrophy and move to competing solutions that don't require jumping through hoops to maintain a robust filtering system. When it's too big of a pain, people would just be using something else. Natural selection.
The procmail users periodically discuss resuming maintainership, but so far no one has. I guess we conclude from that that the pain-point hasn't been reached. But it might still someday.
Nate
Posted Nov 29, 2010 16:57 UTC (Mon)
by nix (subscriber, #2304)
[Link]
Posted Nov 25, 2010 22:31 UTC (Thu)
by jrosdahl (subscriber, #29408)
[Link]
Posted Nov 26, 2010 0:54 UTC (Fri)
by brianomahoney (guest, #6206)
[Link] (2 responses)
If we start talking "abandonware" we have lost the plot, OSS is like an old book, we just need reference/copyright libraries so all copies dont get lost.
In the case of procmail its really useful so the pay-for-distros RedHat, SuSE, ... should man up and take responsibility for long term support, even if it only takes the form of a Free Beer for some older/retired developer to do the security patches.
Just when Linux is getting real traction in the embedded space we do not want to screw our server, super-computer or desktop users.
Abandoning useful code, gratuitous breakage and the un-necessary and capricous glibc 'romprement gratuite d'année' ie the memcpy debacle ...Yes SSE code can be used fore something.
Posted Nov 26, 2010 10:00 UTC (Fri)
by mpr22 (subscriber, #60784)
[Link] (1 responses)
Looks like there's something wrong with procmail.
Posted Dec 2, 2010 12:28 UTC (Thu)
by robbe (guest, #16131)
[Link]
Special handling is only needed if you want to modify and/or extract the mail headers via a natural format. E.g. the result of
Posted Nov 26, 2010 2:36 UTC (Fri)
by ricky (subscriber, #45937)
[Link] (1 responses)
Posted Dec 22, 2010 20:29 UTC (Wed)
by jhardin@impsec.org (guest, #15045)
[Link]
No, it _isn't_ fair to portray CVE-2002-2034 as an unfixed procmail vulnerability, as it is neither unfixed (note the CVE entry says "_before_ 1.133") nor a vulnerability in procmail.
If you follow the links and look at the dates of the vulnerability reports and of the fix in the Sanitizer change log, you'll see that the vulnerability reports were generated from someone seeing in my change log that I had fixed a potential problem.
Posted Nov 26, 2010 14:18 UTC (Fri)
by dwmw2 (subscriber, #2063)
[Link]
Posted Nov 26, 2010 22:02 UTC (Fri)
by rilder (guest, #59804)
[Link]
Regarding the discussion regarding procmailrc and whether it is programming or not, I certainly don't think an average computer user would consider it simple. Only people who have written lightweight RE before and are willing to learn more in that, come forward to use this. So, I don't think procmail is targetted at a normal users, but at people who may like advanced customization, and/or email providers.
Posted Nov 27, 2010 19:14 UTC (Sat)
by joey (guest, #328)
[Link]
Posted Dec 22, 2010 19:48 UTC (Wed)
by lostwizard (guest, #57225)
[Link]
Procmail has supported Maildir natively since version 3.14. Since the latest version is 3.22, stating that it only supports mbox is a bit disingenuous or indicative of shoddy research. In fact, the version of the "mini-FAQ" linked from this article is NOT the same one linked from the procmail.org site!
Posted Dec 25, 2010 5:42 UTC (Sat)
by MattPerry (guest, #46341)
[Link] (5 responses)
Posted Jan 10, 2011 18:28 UTC (Mon)
by obspsr (subscriber, #56917)
[Link] (4 responses)
Posted Apr 19, 2013 20:40 UTC (Fri)
by deesto (guest, #90481)
[Link] (3 responses)
Posted Apr 23, 2013 11:36 UTC (Tue)
by nix (subscriber, #2304)
[Link] (2 responses)
It's unfortunate. Like a lot of other people, I rely utterly on procmail, and nothing else can replace it (mostly 'cos nothing else seems to be able to run random Unix programs and feed them messages, or run Unix programs to decide where messages should go). procmail is horrible, but it's the only mailfilter that really has any of the Unix Way about it... and now it's gone the way of cron, with the distros' independent maintenance its only hope.
Posted Apr 25, 2013 15:38 UTC (Thu)
by jubal (subscriber, #67202)
[Link] (1 responses)
Posted May 10, 2013 13:48 UTC (Fri)
by nix (subscriber, #2304)
[Link]
Posted May 2, 2020 11:47 UTC (Sat)
by salewski (subscriber, #121521)
[Link] (1 responses)
In the absence of anybody taking up the mantle, maybe it really is time to transition to using something else (for real this time(?)).
[0] https://marc.info/?l=openbsd-ports&m=141634350915839&...
Posted May 3, 2020 11:36 UTC (Sun)
by mathstuf (subscriber, #69389)
[Link]
maildrop[1] got mentioned on the mutt-users list recently. I don't use either, so I can't comment personally.
Posted Mar 2, 2022 18:21 UTC (Wed)
by anarcat (subscriber, #66354)
[Link]
What happened next is pretty amazing: it seems procmail is actually back from the dead. The original author actually popped in the bug report and said procmail development was active again, and since May 2020 too. Changes made to the procmail code base since then have been somewhat minor, in my opinion.
I still consider the procmail problem to still be complete and wrote this article named procmail considered harmful, with not quite an apology to Dijkstra (or, to be more accurate, the ACM editors)...
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
Sieve
Reports of procmail's death are not terribly exaggerated
It makes my eyes bleed. Easily the most unreadable source
still in common use.
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
There's also sortmail, whose recipe syntax is python:
Plugging my own
Plugging my own
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
writing rules to sort emails has nothing to do with programming.
Reports of procmail's death are not terribly exaggerated
And I'm still *VERY* fuzzy on what the advantage of all this stuff is over keyword = value config files - don't start with the XML crap, either, it's mostly a longer version of keyword = value...
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
What about smartlist ?
What about smartlist ?
What about smartlist ?
Another alternative (in at least some situations) is maildirproc.
Reports of procmail's death are not terribly exaggerated
procmail support
procmail support
Ed Blackman noted that procmail cannot correctly handle MIME headers adhering to RFC 2047 (which include non-ASCII text), despite the fact that RFC 2047 dates back to 1996. RFC 2047-formatted headers are far from mandatory, but they do continue to rise in frequency.
procmail support
$ formail -I "Subject: i am naïve"
will not be compliant with rfc2047, and
$ formail -x Subject
will *not* undo any encoding and just return the raw header content. Not a big deal, I think.
Reports of procmail's death are not terribly exaggerated
unfixed procmail vulnerabilities. These seem to be security issues
(lack of shell escaping) in an Email Sanitizer project and Horde, which
happen to use procmail, not procmail itself.
Reports of procmail's death are not terribly exaggerated
> unfixed procmail vulnerabilities. These seem to be
> security issues (lack of shell escaping) in an
> Email Sanitizer project ...
I ditched procmail years ago and just use Exim filters.
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
maildir in procmail
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
Reports of procmail's death are not terribly exaggerated
old news: last maintainer: "the code is not safe and should not be used as a basis for any further work"
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769938
old news: last maintainer: "the code is not safe and should not be used as a basis for any further work"
I can't believe I have to do this, but I should mention here that this story is still very relevant. I filed a bug report against procmail in Debian to request that it would be removed from Debian, after finding, to my horror, that not only it was still shipped in Debian, it was actually installed on about 90 servers I managed, complete with a known NULL deref vulnerability.
Reports of procmail's death are not terribly exaggerated
